﻿using ByteSite.Common;
using Newtonsoft.Json;
using SqlSugar;
using System;
using System.Collections.Generic;

namespace ByteSite.Entitys
{
    /// <summary>
    /// 文章主实体类
    /// </summary>
    [Serializable]
    public class article
    {
        public article()
        { }

        [SugarColumn(IsPrimaryKey = true, IsIdentity = true)]
        public int id { get; set; }

        public int site_id { get; set; }

        public int channel_id { get; set; }

        public int category_id { get; set; }

        public int brand_id { get; set; }

        public string call_index { get; set; }

        public string title { get; set; }

        public string link_url { get; set; }

        public string img_url { get; set; }

        public string seo_title { get; set; }

        public string seo_keywords { get; set; }

        public string seo_description { get; set; }

        public string tags { get; set; }

        public string zhaiyao { get; set; }


        [SugarColumn(Length = int.MaxValue)]
        public string content { get; set; }

        public int sort_id { get; set; }

        public int click { get; set; }

        public int status { get; set; }

        public int is_msg { get; set; }

        public int is_top { get; set; }

        public int is_red { get; set; }

        public int is_hot { get; set; }

        public int is_slide { get; set; }

        public int is_sys { get; set; }

        public int like_count { get; set; }

        public string user_name { get; set; }
        [JsonConverter(typeof(TcDateTimeConverter))]
        public DateTime add_time { get; set; }
        [JsonConverter(typeof(TcDateTimeConverter))]
        public DateTime? update_time { get; set; }

        [SugarColumn(IsIgnore = true)]
        public Dictionary<string, object> fields { get; set; }


        [SugarColumn(IsIgnore = true)]
        public List<Entitys.dt_article_albums> albums { get; set; }


        [SugarColumn(IsIgnore = true)]
        public List<Entitys.dt_article_attach> attach { get; set; }


        [SugarColumn(IsIgnore = true)]
        public List<Entitys.dt_article_goods> goods { get; set; }


        [SugarColumn(IsIgnore = true)]
        public List<Entitys.dt_article_goods_spec> specs { get; set; }
    }
}